package vy.org.app.page.lookup.upload;

import java.io.BufferedReader;
import java.io.FileReader;

import org.vy.dal.dao.lookup.VyLookupCitiesDAO;
import org.vy.dal.dao.lookup.VyLookupCitiesDO;

public class CityLookupUpoad {
	public static void main(String[] s) throws Exception {
		BufferedReader fr = new BufferedReader(new FileReader("D:\\VYSofts\\VyManagement\\src\\vy\\org\\app\\page\\lookup\\upload\\cities_data.txt"));
		String line = fr.readLine();
		int i=1;
		do{
			try{
			line = fr.readLine();
			String[] arr=line.split(":");
			
			VyLookupCitiesDO dto = new VyLookupCitiesDO();
			
			dto.setCityCode(String.valueOf(i));
			dto.setCityName("Dummy City "+ i);
			dto.setCountryCode(arr[9]);
			dto.setCountryName(arr[0]);
			dto.setStateCode(arr[1]);
			dto.setStateName(arr[2]);
			VyLookupCitiesDAO.insert(dto);
			System.out.println(dto.getStateName());
			}catch(Exception ex){
				ex.printStackTrace();
			}
			i++;
		}while(line != null);
	}
}
